package org.sy.lab.Java7并发编程实战.一线程管理.十二使用工厂类创建线程;

public class Main {
	public static void main(String[] args) {
		MyThreadFactory factory = new MyThreadFactory("MyThreadFactory");
		Task task = new Task();
		Thread thread;
		System.out.printf("Startibg the Threads\n");
		for(int i=0; i<10; i++) {
			thread = factory.newThread(task);
			thread.start();
		}
		System.out.printf("Factory stats:\n");
		System.out.printf("%s\n", factory.getStats());
	}
}
